home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 December / macformat-019.iso / Shareware City / Printing / PrintJobQuery Folder / PrintQueue.Instructions.txt < prev   
Encoding:
Text File  |  1993-03-19  |  5.9 KB  |  146 lines  |  [TEXT/KAHL]

  1. Application:    Print Job Query
  2.  
  3. History:
  4. Feb. 12th, 1993    V1.00    Created and tested.
  5. Feb. 19th, 1993    V1.01    Added code to display error messages, 
  6.                         include host name, printer name, 
  7.                         and time of query.
  8. March 2th, 1993    V1.02    Fix bug with receive data code.
  9. March 6th, 1993    V1.03    Fix bug which cause it to crash if openconnect failed (-23015).
  10. March 19th,1993    V1.1     - Added Host menu option (Str# 129)
  11.                         - Added Finder Information for Balloon help
  12.                         - caching of IP Address between queires.
  13.                         - Background update every 5 mins of current status (zero = diabled).
  14.                           (STR# 128, index 15).
  15.                           
  16. Display one or more unix lpr queues on a Macintosh by running a unix
  17. script to get the status of the selected printers.
  18.  
  19. This program is free, it can not be sold or bundled with any 
  20. commercial program (except NetDoctor), but it may be distributed with CAP.
  21.  
  22. Send suggestions, bug reports to:
  23.  
  24. By: R. Mark Fleming
  25. Phone: (613) 545-2039           Fax:   (613) 544-7499
  26. InterNet: markf@POST.QueensU.CA 
  27.  
  28. ** The Author of NetDoctor,  a Lab and Network Maintainer Package **
  29.  
  30. *************** Macintosh Program Requirements *************************
  31.  
  32. Requires:
  33. * MacTCP installed.
  34. * 200K of free memory (may run with less, have not tried).
  35. * System 6 or 7. 
  36.  
  37. Errors: During status query, two possible error message are returned.
  38.  
  39. 1) Domain Name Server not responding.
  40.    Error # -xx.
  41. 2) Server not responding or could not connect.
  42.    Error # -xx.
  43.    
  44. The Macintosh error code -xx will be most likely be a MacTCP error 
  45. code in the range -230xx. 
  46. eg.
  47.  -23015        the connection came halfway up and then failed 
  48.              (Check Unix TCP Permisions/Security setttings of destination host).
  49.  
  50. NOTE:    Does not support System 7's AppleEvents.
  51.  
  52. ***** The Details on Unix Side ***************************************
  53.  
  54. From: mike@ccs-master.queensu.ca (Mike Smith)
  55. To: MARKF@POST.QUEENSU.CA (Mark Fleming)
  56. Subject: Laser Printer Queries
  57. Date: Wednesday, 17 February 1993
  58.  
  59.    The nature of the Unix print subsystem means that our LaserJet IIIsi
  60. is 12 logical printers.  That is, there are 12 printcap entries and 12
  61. spool directories that point to the one physical printer.  Each logical printer
  62. identifies the form to be printed and whether the job is single- or double-sided
  63. This potentially bewildering situation is made manageable by a simple naming
  64. convention: each logical printer name is the concatenation of a physical printer
  65. name, a form name, and the letter D if the output is double-sided.  For the IIIs
  66. this gives names like ccsaletter, ccsaletterD, ccsa3hole, ccsa3holeD, and so on.
  67.  
  68.    Normally, two logical printers are active at once, e.g. ccsaletter and ccsale
  69. We use the second paper bin on the IIIsi for coloured separator sheets.  If
  70. the second bin were loaded with 3hole then 4 logical printers would normally
  71. be active.  (By active I mean that the queues will empty as the physical printer
  72. becomes available.  The other logical printers will queue jobs but not print unt
  73. the operator loads the form.)
  74.  
  75.    This separation into multiple logical printers is generally unimportant to
  76. the user.  In particular, when (s)he queries the IIIsi queue, it is expected
  77. that all jobs queued for the 12 logical printers will be listed.
  78.  
  79.    On the VM (or Mac) side, a socket is opened on port 15000.  This number
  80. was arbitrarily assigned by the Systems group.  Port 15000 is defined in
  81. /etc/services as
  82.  
  83. rqlaser         15000/tcp  # Remote laser printer query
  84.  
  85. and in /etc/inetd.conf as
  86.  
  87. rqlaser         stream tcp nowait opprt1 /home/ccs-master/opprt1/rqlaser rqlaser
  88.  
  89. The second last column is the path to a shell script that runs lpq once on
  90. each printer and nawks the lpq output to produce a table that includes the
  91. form name for each job.  The nawk script also greps files that originated on the
  92. Mac for %%For and %%Title comments.  The values of these comments replace the
  93. lwsrv process owner (root) and lwsrv spool file name.  This makes the output
  94. of rqlaser considerably more informative than the unmodified lpq data.
  95.  
  96.    Hope this helps,
  97.  
  98.  Mike Smith                                  mike@ccs.queensu.ca
  99.  Queen's University                          Michael.D.Smith@QueensU.CA
  100.  Computing and Communications Services       (613) 545-2024
  101.  
  102. ************** Sample Unix Script that uses lpq ************************
  103.  
  104. #!/bin/sh
  105. # rqlaser is called by the inetd daemon to service remote queries for
  106. # laser printer queues.  The printer name is read from the standard
  107. # input.  At Queen's we run a more elaborate script to support special
  108. # forms.  This example simply calls the standard lpq command.
  109. read Printer
  110. /usr/ucb/lpq -P$Printer
  111.  
  112.         
  113. *************** Macintosh Program Configuring ***********************
  114.  
  115. Configuring Query program with ResEdit:
  116.  
  117. Use ResEdit to congiure STR# resource 128 as follows:
  118.  
  119. 1)    Unix host name to connect to 
  120.     (Domain Name Server is used to lookup IP Address).
  121. 2)    Printer name passed as command to unix host once the 
  122.     connection is opened.
  123. 10, 11, 12 are messages, if they are not empty the following information will be displayed: 
  124.     host name, printer name, and update time in status window.
  125. 14) TCP/IP port to connect to:
  126.     Must match what you defined in /etc/services on the unix side.
  127. 15) Number of minutes between doing a query update, set to zero to disable.
  128.     
  129. All other strings are messages in this resource are displayed during query.
  130.  
  131.  
  132. **************** Host Menu Configuration *****************************
  133.     
  134.     STR# 129  contains the list of host and other related information.
  135.     
  136.     Each menu entry consists of 4 entries in this string, they are as follows:
  137.     - Description displayed in the menu 
  138.         (You can assign Command Key to options to items  eg. /P - for Command-P),
  139.          See: Inside Mac or Think Reference and lookup InsMenuItem() routine).
  140.     - host address to query
  141.     - command to send to the host
  142.     - port number to query
  143.     
  144.     If this STR# resource is not present, no "Host" menu will be created and the
  145.     information stored in STR# 128 will be used.
  146.